<%@ page contentType="text/html; charset=UTF-8" session="false"%>
<%
	String caption = "数据库连接";
%>
<%@ include file="header.jsp"%>


<%@page import="com.zhangyj.db.Database"%>
<%@page import="com.zhangyj.db.DBFactory"%><span class="title">数据库连接信息</span>:
	<%
		String[] aliases = org.logicalcobwebs.proxool.ProxoolFacade.getAliases();
		for (int i = 0; i < aliases.length; i++) {
			org.logicalcobwebs.proxool.admin.SnapshotIF ss = org.logicalcobwebs.proxool.ProxoolFacade.getSnapshot(aliases[i]);
			String dbname = "";
			try {
				Database dbc = DBFactory.newConnection();
				dbname = dbc.getMetaData().getDatabaseProductName();
				dbc.close();
				dbc = null;
			} catch (java.sql.SQLException e) {
			}
	%>
	<table style="border: solid 1px #80A0C0; width:300px; border-collapse: collapse; " border="1" cellpadding="6" cellspacing="0" borderColor="#C0C0C0">
	<tr><td colspan="2" style="background-color:#f8f8f8; font-weight:bold">连接池 -- <u><%=aliases[i]%></u></td></tr>
	<tr><td>数据库类型：</td><td width="100px" align="center"><%=dbname%></td></tr>
	<tr><td>当前总数据库连接数：</td><td align="center"><%=ss.getConnectionCount()%></td></tr>
	<tr><td>可用的数据库连接数：</td><td align="center"><%=ss.getAvailableConnectionCount()%></td></tr>
	<tr><td>当前被使用连接数：</td><td align="center"><%=ss.getActiveConnectionCount()%></td></tr>
	<tr><td>最大允许连接数量：</td><td align="center"><%=ss.getMaximumConnectionCount()%></td></tr>
	</table>
	<br/>
	<%
		}
	%>
<%@ include file="footer.jsp"%>

